<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/struts-bean" prefix="bean"%>
<%@ taglib uri="/WEB-INF/tld/struts-html" prefix="html"%>
<%@ taglib uri="/WEB-INF/tld/struts-logic" prefix="logic"%>
<%@ taglib uri="/WEB-INF/tld/jstl/c" prefix="c"%>
<%@ taglib uri="/WEB-INF/tld/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="/WEB-INF/tld/jstl/fn" prefix="fn"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="ebb365,ebb365,ebb365">
		<meta http-equiv="description" content="ebb365">
		<title>广告描述管理</title>
		<link rel="stylesheet" type="text/css" href="/admin/css/css.css">
		<script type='text/javascript' src='/dwr/interface/homeSiteDWRServ.js'></script>
		<script type='text/javascript' src='/dwr/engine.js'></script>
		<script type='text/javascript' src='/dwr/util.js'></script> 
		
		<script type="text/javascript">
		<!--//
				function checkForm()
				{
					//alert('hsDesId 值：'+document.forms[0].hsDesId.value);
					
				  var f = document.forms[0];
				  	if(document.getElementById('firstNewsClassId').value==-1)
				  	{
				     alert('请选择一个一级分类');
				     return false;
				  	}
				  
				  	if(document.getElementById('secondNewsClassId').value==-1)
				  	{
				     alert('请选择一个二级分类');
				     return false;
				  	}
				  	
				  	var picName = document.getElementById('picName');
				  	if(picName.value==null || picName.value=='')
				  	{
				  	 alert('请输入图片名称');
				     return false;
				  	}
					var	picInfo = document.getElementById('picInfo');
					if(picInfo.value==null || picInfo.value=='')
				  	{
				  	 alert('请输入图片描述');
				     return false;
				  	}
					
					var bigWidth = document.getElementById('bigWidth');
				  	if(bigWidth.value==null ||bigWidth.value=='')
				  	{
				  	 alert('请输入最大的宽度');
				     return false;
				  	}
				  	var bigHeight = document.getElementById('bigHeight');
				  	if(bigHeight.value==null ||bigHeight.value=='')
				  	{
				  	 alert('请输入最大的高度');
				     return false;
				  	}
				  	var bigSize = document.getElementById('bigSize');
				  	if(bigSize.value==null ||bigSize.value=='')
				  	{
				  	 alert('请输入最大文件大小');
				     return false;
				  	}
				  
				  return true;
				}
				
			 -->	
		</script>
		<script type="text/javascript" language="javascript">
		  //通过一级分类id,获取二级分类的列表
		  function loadSecondHomeSiteClassList()
		  {
		      var newsClassId = document.getElementById('firstNewsClassId').value;
		     if(newsClassId!=null  && newsClassId!='-1')
		     {
		       //alert('广告栏目id:'+newsClassId);
		        //获取二级列表
		        homeSiteDWRServ.loadSecondHomeSiteNewsClassByAdType(newsClassId,fillSecondList);
		        
		     }
		  }
		  
		  
		  //通过二级分类id,获取三级分类的列表
		   function loadThirdHomeSiteClassList()
		  {
		      var newsClassId = document.getElementById('secondNewsClassId').value;
		     if(newsClassId!=null  && newsClassId!='-1')
		     {
		       //alert('广告栏目id:'+newsClassId);
		        //获取二级列表
		        homeSiteDWRServ.loadSecondHomeSiteNewsClassByAdType(newsClassId,fillThirdList);
		     }
		  }
		     
		  
		  //二级分类列表
		  var data2;
		  function fillSecondList(data2)
		  {
		    DWRUtil.removeAllOptions("secondNewsClassId");
            //DWRUtil.addOptions("secondNewsClassId", data2.id,data2.picName);
            DWRUtil.addOptions("secondNewsClassId", {'-1':'请选择'});
            DWRUtil.addOptions("secondNewsClassId", data2);
		  }
		  
		  
		  //填充三级分类列表
		  var data3;
		  function fillThirdList(data3)
		  {
		    DWRUtil.removeAllOptions("thirdNewsClassId");
            //DWRUtil.addOptions("thirdNewsClassId", data3.id,data3.picName);
            DWRUtil.addOptions("thirdNewsClassId", {'-1':'请选择'});
            DWRUtil.addOptions("thirdNewsClassId", data3);
		  }
		  
		</script>
		
	</head>
	<body>
				
		<html:form action="/admin/banner/homeSiteAdBannerDesprite.do?action=add" method="post" onsubmit="return checkForm();">
				
				<table width="100%" height="201" border="0" cellpadding="3"
					cellspacing="1">
					<tr height="30">
						<td width="10%" bgcolor="#FEDFC0" class="STYLE1" colspan="5" align="center">
							广告描述---添加
						</td>
					</tr>
					<tr height="50">
						<td width="10%" bgcolor="#FEDFC0" class="STYLE1">
							分 类：
						</td>
						<td width="20%" bgcolor="#F6F6F6">
							<span class="STYLE1">一级分类</span>
							<html:select property="firstNewsClassId" onchange="loadSecondHomeSiteClassList();">
							   <html:option value="-1">---请选择---</html:option>
							   <html:optionsCollection name="firstHomeSiteNewsClassList" label="names" value="id"/>
							</html:select>
							<font color="red">*</font>
						</td>
						<td width="20%" bgcolor="#F6F6F6">
							<span class="STYLE1">二级分类</span>
							<html:select property="secondNewsClassId" onchange="loadThirdHomeSiteClassList();">
							   <html:option value="-1">---请选择---</html:option>
							</html:select>
							<font color="red">*</font>
						</td>
						<td width="20%" bgcolor="#F6F6F6">
							<span class="STYLE1">三级分类</span>
							<html:select property="thirdNewsClassId">
							   <html:option value="-1">---请选择---</html:option>
							</html:select>
							<font color="red">*</font>
						</td>
						
					</tr>
					
					<tr height="50">
						<td bgcolor="#FEDFC0" class="STYLE1">
							图片名称：
						</td>
						<td bgcolor="#F6F6F6" colspan="3">
							<html:text property="picName" value="" maxlength="50" size="50"></html:text>
							<font color="red">*</font>
						</td>
					</tr>
					
					<tr height="50">
						<td bgcolor="#FEDFC0" class="STYLE1">
							图片描述：
						</td>
						<td bgcolor="#F6F6F6" colspan="3">
							<html:text property="picInfo" value="" maxlength="50" size="50"></html:text>
							<font color="red" size="2">*　</font>
						</td>
					</tr>
					
					<tr height="50">
						<td bgcolor="#FEDFC0" class="STYLE1">
							图片设置：
						</td>
						<td bgcolor="#F6F6F6" colspan="3">
最大宽度：<html:text property="bigWidth" value="" maxlength="６" size="4"></html:text> px　<font color="red">*</font>　
最大高度：<html:text property="bigHeight" value="" maxlength="６" size="4"></html:text> px　<font color="red">*</font>　
最大大小：<html:text property="bigSize" value="" maxlength="10" size="4"></html:text> k　<font color="red">*</font>　
是否删除：<input type="radio" name="del" value="1">是</input>　<input type="radio" name="del" value="1" checked>否</input>
						</td>
					</tr>
					
					
					<tr height="30">
						<td bgcolor="#F6F6F6" class="STYLE1"></td>
						<td bgcolor="#F6F6F6" colspan="3">
							<input type="submit" value="确定添加">　　　　
							<input type="reset" value="重　　置">&nbsp;
						</td>
					</tr>
					
				</table>
				
				
				
		</html:form>
		<logic:present name="msg">
			<bean:write name="msg" filter="false"/>
		</logic:present>
	</body>
</html>    		